﻿@namespace Text2Sql.Net.Web
@inherits LayoutComponentBase

<AntDesign.ProLayout.BasicLayout Logo="@("https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg")" MenuData="_menuData">
    <RightContentRender>
        <Text2Sql.Net.Web.Components.RightContent />
    </RightContentRender>
    <ChildContent>
        @Body
    </ChildContent>
    <FooterRender>
        <FooterView Copyright="2025 许泽宇的技术分享" Links="Links"></FooterView>
    </FooterRender>
</AntDesign.ProLayout.BasicLayout>
<SettingDrawer />

<style>
    .ant-pro-global-footer {
        margin: 0px;
    }
</style>

@code
{
    private MenuDataItem[] _menuData = { };

    [Inject] public HttpClient HttpClient { get; set; }

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();
        _menuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json");
    }


    public LinkItem[] Links { get; set; } =
    {
        new LinkItem
        {
            Key = "Text2Sql.Net",
            Title = "Text2Sql.Net",
            Href = "https://github.com/AIDotNet/Text2Sql.Net",
            BlankTarget = true,
        }
    };
}

